Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing proguard rules #502

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add missing proguard rules #502

wants to merge 2 commits into from

Conversation

4brunu
Copy link
Contributor

@4brunu 4brunu commented Apr 21, 2023

Hi,
My project uses PdfBox-Android and everything was working great.
But when I upgraded AGP to 8.0.0 it switches automatically to proguard full mode, and that broke my builds.

ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/user/Developer/Project/app/build/outputs/mapping/adhoc/missing_rules.txt.
ERROR: R8: Missing class com.gemalto.jp2.JP2Decoder (referenced from: android.graphics.Bitmap com.tom_roush.pdfbox.filter.JPXFilter.readJPX(java.io.InputStream, com.tom_roush.pdfbox.filter.DecodeOptions, com.tom_roush.pdfbox.filter.DecodeResult))
Missing class com.gemalto.jp2.JP2Encoder (referenced from: void com.tom_roush.pdfbox.filter.JPXFilter.encode(java.io.InputStream, java.io.OutputStream, com.tom_roush.pdfbox.cos.COSDictionary))

The missing_rules.txt file add the following content.

# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn com.gemalto.jp2.JP2Decoder
-dontwarn com.gemalto.jp2.JP2Encoder

I tried to add those to my proguard file and it fixed the builds.

So I'm creating this PR to make the proguard rules more complete and easier to use for everyone.

@TomRoush TomRoush added the type: bug Existing feature doesn't work correctly label Apr 27, 2023
@TomRoush TomRoush added this to the v2.0.27.1 milestone Apr 27, 2023
Copy link

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get this released?

@terryschmidtservicenow
Copy link

Please merge this and get 2.0.27.1 out the door! Need support for ICCBased colorspaces over here

@dinhthaidaica
Copy link

This piece of information is crucial important, hence it should be added to ReadMe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Existing feature doesn't work correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants